home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / dev / misc / FD2Pragma.lha / Source / SDI_ASM_STD_protos.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-27  |  3.9 KB  |  111 lines

  1. #ifndef SDI_ASM_STD_PROTOS_H
  2. #define SDI_ASM_STD_PROTOS_H
  3.  
  4. /* Includeheader
  5.  
  6.     Name:        SDI_ASM_STD_protos
  7.     Versionstring:    $VER: SDI_ASM_STD_protos.h 1.11 (06.02.97)
  8.     Author:        SDI
  9.     Distribution:    PD
  10.     Description:    my replacement for standard ANSI functions
  11.  
  12.  1.9   18.11.96 : converted text into english language, changed C++ comments
  13.      to C ones
  14.  1.10  29.11.96 : added printf
  15.  1.11  06.02.97 : added exit prototype
  16. */
  17.  
  18. /* These are mainly the normal ANSI C functions, but with an ASM interface.
  19. You can replace them by their normal functions supplied with your compiler,
  20. but do not mix them up (one object file standard, the other one SDI).
  21.  
  22. differences:
  23.  toupper and tolower: chars (0x41 to 0x5A) and (0xC0 to 0xDE) are upper
  24.   chars (0x61 to 0x79) and (0xE0 to 0xFE) are lower (some more than in ANSI)
  25.  isprint: chars (0x20 to 0x7F) and (0xA0 to 0xFF) are printable
  26.  sprintf and printf: only support exec/RawDoFmt format strings
  27.  and some I do not remember.
  28.  
  29. printf: Use this function only for programs need to work under OS1.3. For
  30. OS2.0 (and up) only programs use dos.library/amiga.lib Printf function.
  31. */
  32.  
  33. #include <exec/types.h>
  34.  
  35. #ifdef __MAXON__
  36.   #define __asm
  37. #endif
  38.  
  39. #ifdef __cplusplus
  40. extern "C" {
  41. #endif
  42.  
  43. BYTE __asm SDI_strnicmp(register __a0 STRPTR,    /* string 1            */
  44.             register __a1 STRPTR,    /* string 2            */
  45.             register __d1 ULONG);    /* highest testlength        */
  46. BYTE __asm SDI_strncmp(    register __a0 STRPTR,    /* string 1            */
  47.             register __a1 STRPTR,    /* string 2            */
  48.             register __d1 ULONG);    /* highest testlength        */
  49. UBYTE __asm SDI_tolower(register __d0 UBYTE);    /* character to convert        */
  50. UBYTE __asm SDI_toupper(register __d0 UBYTE);    /* character to convert        */
  51. ULONG __asm SDI_strlen( register __a0 STRPTR);    /* string            */
  52. ULONG __asm SDI_isprint(register __d0 UBYTE);    /* character to convert        */
  53. ULONG __asm SDI_isdigit(register __d0 UBYTE);    /* character to convert        */
  54. ULONG __asm SDI_isxdigit(register __d0 UBYTE);    /* character to convert        */
  55. ULONG __asm SDI_isalnum(register __d0 UBYTE);    /* character to convert        */
  56. ULONG __asm SDI_isupper(register __d0 UBYTE);    /* character to convert        */
  57. ULONG __asm SDI_strtoul(register __a1 STRPTR,    /* buffer            */
  58.             register __a0 UBYTE **,    /* UBYTE var for error position    */
  59.             register __d2 UBYTE);     /* base                */
  60. ULONG __asm SDI_strtol(    register __a1 STRPTR,    /* buffer            */
  61.             register __a0 UBYTE **,    /* UBYTE var for error position */
  62.             register __d2 UBYTE);     /* base                */
  63. STRPTR __asm SDI_strncpy(register __a1 STRPTR,    /* string 1            */
  64.             register __a0 STRPTR,    /* string 2            */
  65.             register __d1 ULONG);    /* highest copy number        */
  66. void __asm SDI_memset(    register __a1 APTR,    /* buffer            */
  67.             register __d0 UBYTE,    /* fill character        */
  68.             register __d1 ULONG);    /* number of bytes        */
  69. STRPTR __asm SDI_strchr(register __a1 STRPTR,    /* buffer            */
  70.             register __d0 UBYTE);    /* character to scan for    */
  71. void SDI_sprintf(STRPTR, STRPTR, ...);        /* buffer, formatdata, data    */
  72. void SDI_printf(STRPTR, ...);            /* formatdata, data        */
  73.  
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77.  
  78. #define SDI_stricmp(a,b)    SDI_strnicmp(a,b,~0)
  79. #define SDI_strcmp(a,b)        SDI_strncmp(a,b,~0)
  80. #define SDI_strcpy(a,b)        SDI_strncpy(a,b,~0)
  81.  
  82. /* Set SDI_TO_ANSI if you want to use normal ansi names. Do not include
  83. the ANSI files stdio.h / stdlib.h ... , because this may result in an error */
  84.  
  85. #ifdef SDI_TO_ANSI
  86.   #define strnicmp    SDI_strnicmp
  87.   #define strncmp    SDI_strncmp
  88.   #define stricmp    SDI_stricmp
  89.   #define strcmp    SDI_strcmp
  90.   #define tolower    SDI_tolower
  91.   #define toupper    SDI_toupper
  92.   #define strlen    SDI_strlen
  93.   #define isprint    SDI_isprint
  94.   #define isdigit    SDI_isdigit
  95.   #define isxdigit    SDI_isxdigit
  96.   #define isalnum    SDI_isalnum
  97.   #define strtoul    SDI_strtoul
  98.   #define strtol    SDI_strtol
  99.   #define strncpy    SDI_strncpy
  100.   #define strcpy    SDI_strcpy
  101.   #define strchr    SDI_strchr
  102.   #define memset    SDI_memset
  103.   #define sprintf    SDI_sprintf
  104.   #define printf    SDI_printf
  105. /*#define memcpy(a,b,c)    CopyMem(b,a,c) */
  106.  
  107.   extern void exit(int);
  108. #endif
  109.  
  110. #endif /* SDI_ASM_STD_PROTOS_H */
  111.